/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ac.za.cput.kleintjes.question3.plk.violates.testing;

import ac.za.cput.kleintjes.question3.plk.violates.conf.StudentConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import ac.za.cput.kleintjes.question3.plk.violates.model.Student;
import ac.za.cput.kleintjes.question3.plk.violates.services.IStudent;
import junit.framework.Assert;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Hughan.Kleintjes.hughanK@gmail.com
 */
public class IStudentJUnitTestv {
    private static ApplicationContext ctx;
    private static IStudent student;
    
    public IStudentJUnitTestv() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
        ctx = new AnnotationConfigApplicationContext(StudentConfig.class);
        student = (IStudent)ctx.getBean("student");
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    /**
     * Test of setDefaultStudent method, of class IStudent.
     */
    @Test
    public void testSetDefaultStudent() {
        System.out.println("setDefaultStudent");
        Student stud = student.setDefaultStudent();
        
        Assert.assertEquals(2012, stud.getYearOfStudy());
    }

}
